#ifndef LOGICCHIPBASEENTITY_H
#define LOGICCHIPBASEENTITY_H

#include "../../ecs/entity.h"
#include "../roundpinentity.h"
#include <QSharedPointer>
#include "../../entities/pinentity.h"
#include <QMap>

class LogicChipBaseEntity : public Entity
{
    Q_OBJECT
public:
    explicit LogicChipBaseEntity(QGraphicsItem* parent = nullptr);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    QRectF boundingRect() const override;
    void setDataFile(const QString& fileName) { mDataFile = fileName; }
    QString dataFile() const { return mDataFile; }

    void initChipDatas();
    void tick(const int& ms) override;

signals:

public slots:

private:
    QString mDataFile;
    QString mDataSheetUrl;
    QMap<QString, QStringList> mTruthTable;
    int mPinCount;
    QList<QSharedPointer<PinEntity>> mPins;
    QList<int> mInputs;
    QList<int> mOutputs;
    int mVcc;
    int mGnd;
    int mW;
    int mH;
};

#endif // LOGICCHIPBASEENTITY_H
